package com.hugboy.stringbuilder;

import java.util.Scanner;

public class Demo4stringbuilder {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Input a str:");
        String str =  sc.nextLine();
        boolean flag = isSymmetryStr(str);
        if(flag){
            System.out.println("It is a Symmetry string.");
        }else{
            System.out.println("not Symmetry.");
        }

    }

    public static boolean isSymmetryStr(String str){
        StringBuilder str1 = new StringBuilder(str);
        String r_str = str1.reverse().toString();
        if(str.equals(r_str)){
            return true;
        }else{
            return false;
        }

    }
}
